#pragma once

#include "spdlog/spdlog.h"
#include "spdlog/fmt/ostr.h"


namespace DM {

	class DM_API Log
	{
	public:
		static void Init();

		static std::shared_ptr<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
		static std::shared_ptr<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }

	private:
		static std::shared_ptr<spdlog::logger> s_CoreLogger;
		static std::shared_ptr<spdlog::logger> s_ClientLogger;
	};
}


// Core log macros

#define DM_CORE_ERROR(...)   ::DM::Log::GetCoreLogger()->error(__VA_ARGS__)
#define DM_CORE_WARN(...)    ::DM::Log::GetCoreLogger()->warn(__VA_ARGS__)
#define DM_CORE_INFO(...)    ::DM::Log::GetCoreLogger()->info(__VA_ARGS__)
#define DM_CORE_TRACE(...)   ::DM::Log::GetCoreLogger()->trace(__VA_ARGS__)
#define DM_CORE_CRITICAL(...)   ::DM::Log::GetCoreLogger()->critical(__VA_ARGS__)


// Client log macros

#define DM_ERROR(...)		::DM::Log::GetClientLogger()->error(__VA_ARGS__)
#define DM_WARN(...)		::DM::Log::GetClientLogger()->warn(__VA_ARGS__)
#define DM_INFO(...)		::DM::Log::GetClientLogger()->info(__VA_ARGS__)
#define DM_TRACE(...)		::DM::Log::GetClientLogger()->trace(__VA_ARGS__)
#define DM_CRITICAL(...)		::DM::Log::GetClientLogger()->critical(__VA_ARGS__)
